package edu.netjava.Queue;
/**
 * this class named Queue as it works
 * @author tan
 *
 */

public class Queue {
	
	/**
	 * the array to store the object or data
	 */
	ArrayIncrease da = new ArrayIncrease();
	
	
	/**
	 * the pointer to point the element in the queue
	 */
	int index = -1;
	/**
	 * 
	 * @param object: the value passed into the queue
	 *                the single object into the queue
	 */
	public void enterQueue(Object object){
		da.add(object);
	}
	
	/**
	 * 
	 * @return the first element in the queue
	 */
	public Object getHead(){
		return da.get(0);
	}
	
	/**
	 * 
	 * @return the removed element
	 */
	public void removeHead(){
		da.delete(0);
		System.out.println(da.get(0));
	}
	
	/**
	 * 
	 * @param index :the index of the element to get
	 * @return the wanted element
	 */
	public Object getQueueElement(int index){
		return da.get(index);
	}


	public void printQueue(){
		da.printExitE();
	}

}
